import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// 引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 引入tree组价
import ZkTable from 'vue-table-with-tree-grid'
Vue.component('tree-table', ZkTable)

Vue.config.productionTip = false
router.beforeEach((to, from, next) => {
  if (!store.state.token && to.path !== '/login') {
    next('/login')
  } else {
    next()
  }

})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
